﻿using System.Data.Entity;

namespace EFCore7.Migrations.Seed;

public class BlogSeedAction : ISeedAction
{
    public int Order { get; private set; }

    public BlogSeedAction()
    {
        Order = 1;
    }

    public void Action(DbContext context)
    {
        var blogs = new List<Biz_Blog> {
            new Biz_Blog { BlogId = 1, Url = @"https://devblogs.microsoft.com/dotnet", Rating = 5 },
            new Biz_Blog { BlogId = 2, Url = @"https://mytravelblog.com/", Rating = 4 }
        };
        var postEntities = context.Set<Biz_Blog>();
        postEntities.AddRange(blogs);
        context.SaveChanges();
    }
}